home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
How Would You Survive?
/
How Would You Survive (1995)(Grolier)[Mac-PC].iso
/
pc
/
shared.dir
/
01992_Script_a9StateButton
< prev
next >
Wrap
Text File
|
1995-09-13
|
3KB
|
115 lines
property pSprite,pCast,pNutral,pHilighted,pSelected,pFunction,pMySound,pCursor,¼
pbeenClicked,pRolloverFunction, pSkipReset
on birth me,theSprite,theCast,aSound,aFunction,aCursor,aRolloverFunction, aSkipReset
-- assumes that the sprite has the correct cast member in the correct loc
-- assumes that the normal and depressed art are in cast numbers theCast and theCast + 1
set pSprite = theSprite
set pcursor = aCursor
set pCast = theCast
set pMySound = aSound
set pNutral = pCast
set pSkipReset=aSkipReset
set pHilighted = pCast + 1
set pSelected = pCast + 2
set pFunction = aFunction
set pRolloverFunction = aRolloverFunction
-- puppetSprite pSprite,TRUE
-- set the castNum of sprite pSprite = pCast
return me
end
on setNewFunction me, aFunction
set pFunction = aFunction
end
on setnewRolloverFunction me, aRolloverFunction
--delux--why is this here?
set pRolloverFunction = aRolloverFunction
end
on setNewSound me, aSound
set pMySound = aSound
end
on reset me
set the castNum of sprite pSprite = pNutral
updatestage
end
on hilight me
set pbeenClicked to False
repeat while (rollover(pSprite))
do pCursor
puppettransition 0
if pRolloverFunction = "" then
nothing
else
do pRolloverFunction
end if
if (the castNum of sprite pSprite = pNutral) then
set the castNum of sprite pSprite = pHilighted
if (pMySound) then puppetSound (cast pMySound)
set pbeenClicked to False
Updatestage
else
if (the mouseDown) then
set the castNum of sprite pSprite = pSelected
set pbeenClicked to TRUE
Updatestage
else
-- the mouse is up
if (pbeenClicked = true and rollover(pSprite)) then
if not(pSkipReset) then reset
Updatestage
do pFunction
return TRUE
abort
end if
end if
end if
end repeat
reset
return FALSE
end
on toggle me
set the castNum of sprite pSprite = pSelected
upDateStage
repeat while (the mouseDown)
if rollover(pSprite) then
set the castNum of sprite pSprite = pSelected
set pbeenClicked to true
else
set the castNum of sprite pSprite = pNutral
set pbeenClicked to false
end if
updatestage
end repeat
end
on hideControl me
puppetSprite pSprite, FALSE
end
on showControl me
puppetSprite pSprite,TRUE
end
on changeBaseButton me, newBase
set pCast = newBase
set the castNum of sprite pSprite = pCast
showControl(me)
end
on setDemoHilight me
set the castNum of sprite pSprite = pHilighted
upDateStage
end
on mCastExists me, pName
return (the name of cast pCast starts pName)
end mCastExists